<template>
	<view class="main">
		<view class="m_header">
			<u-section :title="list.title" :right="false" line-color="#009dff" font-size="32"></u-section>
		</view>
		
		<view class="m_center">
			<view class="item" v-for="(item,index) in list.list" :key="index" @click="$emit('click',item.event)">
				<image :src="item.icon" mode=""></image>
				<text>{{item.name}}</text>
				<u-badge v-if="item.hasDots" :count="item.hasDots" type="error" :offset='[14,40]' size='mini'></u-badge>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			}
		},
		props: {
			list: {
				type: Object,
				default: {}
			}
		},
		mounted() {
			console.log(this.list)
		}
	}
</script>

<style lang="scss" scoped>
	
	.main {
		width: 100%;
		padding: 40rpx 30rpx 0 30rpx;
		margin: 0 0 20rpx 0;
		background-color: #FFFFFF;

		.m_center {
			width: 100%;
		    padding-top: 40rpx;
			display: flex;
			justify-content: flex-start;
			align-items: center;
			flex-direction: row;
			flex-wrap: wrap;

			.item {
				width: 25%;
				display: flex;
				justify-content: center;
				align-items: center;
				flex-direction: column;
				margin-bottom: 40rpx;

				image {
					width: 60rpx;
					height: 60rpx;
					margin-bottom: 20rpx;
				}

				text {
					font-size: 24rpx;
					letter-spacing: 4rpx;
					text-align: center;
				}
			}
		}
	}

</style>
